using System;
namespace Coding4Fun.Phone.Controls.Toolkit
{
	public abstract class TimeSpanDataSource : DataSource<TimeSpan>
	{
		protected int Max;
		protected int Step;
		public override bool IsEmpty
		{
			get
			{
				return this.Max - 1 == 0 || this.Step == 0;
			}
		}
		protected TimeSpanDataSource(int int_0, int step)
		{
			this.Max = int_0;
			this.Step = step;
		}
		protected int ComputeRelativeTo(int value, int delta)
		{
			int max = this.Max;
			int num;
			if (max > 0)
			{
				num = (max + value + delta * this.Step) % max;
				num += ((max <= value) ? max : 0);
			}
			else
			{
				num = value;
			}
			return num;
		}
	}
}
